export default function reducer(state = { user: {}, profile: {} }, action) {
  const { type, payload } = action
  // 用户个人资料
  if (type === 'profile/user') {
    return {
      user: payload,
      profile: state.profile,
    }
  }
  // 用户自己的数据
  if (type === 'profile/profile') {
    return {
      user: state.user,
      profile: payload,
    }
  }

  return state
}
